package com.ccc.mq.dynamic.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ccc.mq.dynamic.entity.RocketTopicMsgModel;
import com.ccc.mq.dynamic.pojo.RocketTopicMsgVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface RocketTopicMsgModelMapper extends BaseMapper<RocketTopicMsgModel> {

    @Select("SELECT a.addr_ip, b.id as rocket_topic_id, b.consumer_group, b.topic_name, b.sub_expression, b.msg_model_type, b.orderly FROM rocket_info a left join rocket_topic_msg_model b on a.id = b.rocket_id WHERE b.status = #{status}")
    List<RocketTopicMsgVO> list(@Param("status") Integer status);
}